<?php

/**
 * 患者关系表
 */
namespace app\common\model;

class Relation extends BaseModel
{
    protected $name = "relation";

    /**
     * 获取数据
     * @return array
     */
    public function getDatas(): array
    {
        return $this->field('relationType,relationName')->select()->toArray();
    }

    /**
     * 获取单条数据
     */
    public function getOne($relationType)
    {
        $row = $this->where('relationType', $relationType)->field('relationName')->find();
        return $row['relationName'];
    }
}